<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>聊天室</title>
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/emoji.css">
</head>

<body>
    <div class="container">
        <!-- 登录界面 -->
        <div class="login-container" id="loginContainer">
            <div class="login-box">
                <h2>聊天室登录</h2>
                <div class="input-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" placeholder="请输入用户名">
                </div>
                <div class="input-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" placeholder="请输入密码">
                </div>
                <button id="loginBtn" class="btn">登录</button>
                <p class="error-message" id="loginError"></p>
            </div>
        </div>

        <!-- 聊天界面 -->
        <div class="chat-container" id="chatContainer" style="display: none;">
            <div class="chat-header">
                <h2>聊天室</h2>
                <span id="currentUser"></span>
                <div class="header-buttons">
                    <button id="clearBtn" class="btn-clear">清除记录</button>
                    <button id="logoutBtn" class="btn-logout">退出</button>
                </div>
            </div>
            <div class="chat-main">
                <div class="left-sidebar">
                    <div class="user-list">
                        <h3>在线用户 <span id="onlineCount"></span></h3>
                        <ul id="userList"></ul>
                    </div>
                </div>
                <div class="chat-content">
                    <div class="message-container" id="messageContainer"></div>
                    <div class="message-input">
                        <select id="toUser">
                            <option value="all">所有人</option>
                        </select>
                        <button id="emojiBtn" class="emoji-button">😊</button>
                        <div id="emojiPicker" class="emoji-picker"></div>
                        <input type="text" id="messageInput" placeholder="请输入消息...">
                        <button id="sendBtn" class="btn-send">发送</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="./js/emoji.js"></script>
    <script src="./js/app.js"></script>
</body>

</html>